1. Field of the Invention
This invention relates to a clipping processor for use in a graphics processing system for drawing and displaying graphic forms.
2. Description of the Related Art
Referring first to FIG. 7, there is shown the construction of a prior art clipping processor. In FIG. 7, reference numerals 1 and 2 designate a drawing X coordinate register for storing X coordinates and a drawing Y coordinate register for storing Y coordinates, respectively; 3 and 4 a drawing X coordinate generation unit for computing X coordinates to be drawn and a drawing Y coordinate generation unit for computing Y coordinates to be drawn; 5 and 6 two clipping X coordinate registers, which are respectively used to store an X coordinate of a left end of an area to be clipped and an X coordinate of a right end of the area to be clipped; and 7 and 8 two clipping Y coordinate registers, which are respectively used to store a Y coordinate of a top end of the area to be clipped and a Y coordinate of a bottom end of the area to be clipped. Further, reference numeral 9 denotes a comparator for comparing the contents of the drawing X coordinate register 1 with those of the clipping X coordinate register 5; 10 a comparator for comparing the contents of the drawing X coordinate register 1 with those of the clipping X coordinate register 6; 11 a comparator for comparing the contents of the drawing Y coordinate register 2 with those of the clipping Y coordinate register 7; 12 a comparator for comparing the contents of the drawing Y coordinate register 2 with those of the clipping Y coordinate register 8; 13 a drawing area definition flag setting device for setting a drawing area definition flag indicating that an area to be drawn (hereunder sometimes referred to as a drawing area) is inside or outside the area to be clipped; 14 a clipping judgement unit for judging from the results of the comparisons made by the comparators 9-12 and the contents of the drawing area definition flag setting device 13 that the drawing should be permitted or inhibited; 15 a physical address generation unit for computing addresses, which correspond to X and Y coordinates determined by the drawing X coordinate register 1 and the drawing Y coordinate register 2, in an external storage (not shown); 16 a data processing unit for processing and generating graphic data used for drawing; 17 a data transfer control unit for controlling data transfer between the clipping processor and an external circuit (not shown); 18 an address buffer for outputting the addresses, which are computed by the physical address generation unit 15, to the external storage under the control of the data transfer control unit 17; and 19 a data buffer for performing data input/output between the external storage and the data processing unit 16 under the control of the data transfer control unit 17.
When a part or all of a graphic form to be drawn is clipped by the clipping processor constructed as above described, first, the X coordinates of the right end and the left end of the area to be clipped and the Y coordinates of the top end and the bottom end of the area to be clipped are respectively set in the clipping X coordinates register and the clipping Y coordinate register and further information, which indicates that the area to be drawn is inside or outside the area to be clipped, is set in the drawing area definition flag stored in the device 13 before drawing the graphic form.
Thereafter, when the drawing of the graphic form is started, the coordinates of the graphic form to be drawn are sequentially generated in the drawing X coordinate generation unit 3 and the drawing Y coordinate generation unit 4 and the thus generated coordinates are stored in the drawing X coordinate register 1 and the drawing Y coordinate register 2. Subsequently, the clipping judgement unit 14 judges from the results of the comparisons made by the comparators 9-12 and the contents of the drawing area definition flag setting device 13 that the drawing should be permitted or inhibited, and outputs a control signal to the data transfer control unit 17. In case where the data transfer is permitted, physical addresses generated by the physical address generation unit 15, which correspond to the contents of the drawing X coordinate register 1 and the drawing Y coordinate register 2, are output through the address buffer 18. Further, the external storage and the data processing unit 16 perform input/output operations by way of the data buffer 19. In contrast with this, in case where the data transfer is inhibited by the clipping judgement unit 14, the data transfer is not effected at all and thus the contents of the external storage is not updated. FIG. 8 shows the results of the clipping processing in case of drawing a circle as an example of the above described processing.
However, in the above described prior art clipping processor, the area to be clipped is preliminarily defined and established by using the coordinates stored in four registers, i.e., the clipping X coordinate register 5 and 6 and the clipping Y coordinate register 7 and 8. This results in that in case of the prior art clipping processor, an area to be clipped (hereunder sometimes referred to simply as a clipping area) is limited to rectangular one. Therefore, in case where the clipping processing is performed by using an area defined by a curve, as illustrated in FIG. 2, as a clipping area, the data transfer can be effected only after graphic data on a clipped graphic form is preliminarily generated by using a work area, which is set in the storage separately from data areas used for processing the graphic data on the graphic form to be drawn. Thus, the prior art clipping processor has drawbacks that the data transfer takes time and that the work area is necessary.
The present invention is accomplished to obviate the drawbacks of the prior art clipping processors.